

PATHALEX=/CGH/data/users/cdina/PROGRAMMES/ALEX/COMPARE1000G/db/NEW_1000/

while read line;do # pour chaque chromosome
	
	# repertoires de sortie
	mkdir out_chr$line
	
	# lancement de GTOOL
	/usr/local/package/gtool_v0.6.7/gtool -P --ped mapedfile/input_chr$line.ped --map mapedfile/input_chr$line.map --og out_chr$line/chr$line.gen --os out_chr$line/chr$line.sample --binary_phenotype 

	# lancement d'IMPUTE2
	while IFS="	" read gp start end size;do # pour chaque groupe d'un chromosome
		../pgm/impute2 -h ${PATHALEX}/EUR.chr${line}.impute.hap \
			-l ${PATHALEX}/EUR.chr${line}.impute.legend \
			-m ${PATHALEX}/genetic_map_chr${line}_combined_b37.txt \
			-g out_chr${line}/chr${line}.gen \
			-int ${start} ${end} \
			-Ne 11418 \
			-os 0 1 2 3 \
			-iter 30 \
			-burnin 10 \
			-k 60 3 \
			-k_hap 500 \
			-fix_strand_g \
			-buffer 250 \
			-i out_chr${line}/info_chr${line}.${gp} \
			-o out_chr${line}/sortie_chr${line}.${gp} \
			-r out_chr${line}/quoi_chr${line}.${gp} \
			-pgs \
			-include_snps imputationSetfiles/rslist/target_setfile_SUVIMAX_chr${line}.${gp}.txt \
			-allow_large_regions \ 
	done < imputationSetfiles/windowsetfiles/windowset_SUVIMAX_chr${line}.txt # read windosetfile

done < $1 # read chr_list
